package ruler.services;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class LockBroadcastReceiver extends BroadcastReceiver {
    
	RulerService service;

	public LockBroadcastReceiver(RulerService rulerService) {
		this.service = rulerService;
	}

	@Override
    public void onReceive(Context context, Intent intent) {
        if (Intent.ACTION_SCREEN_OFF.equalsIgnoreCase(intent.getAction())) {
            this.service.pause();
            Log.v("PANTALLA", "APAGADA");
        } else {
        	this.service.resume();
        	Log.v("PANTALLA", "PRENDIDA");
        }
        	
    }

}
